package com.pichub.psdmaster;

import org.apache.log4j.Logger;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class ConnectDB {
	private static Logger logger = Logger.getLogger(ConnectDB.class);


	public static void free(ResultSet rs, Connection conn, Statement stmt) {
		if (rs != null) {
			try {
				rs.close();
			} catch (SQLException e) {

				logger.debug("free rs error:" + e.getStackTrace());
			}
		}
		if (conn != null) {
			try {
				conn.close();
			} catch (SQLException e) {

				logger.debug("free conn error:" + e.getStackTrace());
			}
		}
		if (stmt != null) {
			try {
				stmt.close();
			} catch (SQLException e) {

				logger.debug("free stmt error:" + e.getStackTrace());
			}
		}

	}
}
